package com.hnkywl.sts.quartz;

import com.hnkywl.sts.entity.xsgl.Kh;
import com.hnkywl.sts.service.taskdeal.DoBgcgdSync;
import com.hnkywl.sts.service.taskdeal.DoKhGdqcSync;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Map;

/**
 * Created by Jerry on 14-2-7.
 */
public class KhGdqcSyncJob extends QuartzJobBean {
    // 定义日志
    private static Log log = LogFactory.getLog(PlanImprtJob.class);
    private DoKhGdqcSync doKhGdqcSync;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("khgdqcSync 开始执行............");
        List<Kh> khlist = doKhGdqcSync.findAllGdkh();
        for (Kh kh : khlist) {
            doKhGdqcSync.doGdqcSync(kh);
        }
        log.info("khgdqcSync 执行结束............");
    }

    public DoKhGdqcSync getDoKhGdqcSync() {
        return doKhGdqcSync;
    }

    public void setDoKhGdqcSync(DoKhGdqcSync doKhGdqcSync) {
        this.doKhGdqcSync = doKhGdqcSync;
    }
}
